#ifndef GLOBAL_VARIANT_H
#define GLOBAL_VARIANT_H

#include <QString>
#include <QPair>

//设备状态（环车检查端、驾驶端、捣鼓作业端、下位机端）
enum EquipmentStatusType{
    ExamineExamUnityEquipmentOnline = 0,
    ExamineExamUnityEquipmentOffline,
    RouteExamUnityEquipmentOnline,
    RouteExamUnityEquipmentOffline,
    TampingHomeworkEquipmentOnline,
    TampingHomeworkEquipmentOffline,
    ExamineExamUnityEquipmentLogIn,
    ExamineExamUnityEquipmentLogOut,
    RouteExamUnityEquipmentLogIn,
    RouteExamUnityEquipmentLogOut,
    TampingHomeworkEquipmentLogIn,
    TampingHomeworkEquipmentLogOut,
    LowerComputerEquipmentOnline,
    LowerComputerEquipmentOffline,
};

//设备类型
enum ClientHashEnum{
    ExamineExamUnityEquipment = 0,//运行前检查设备
    RouteExamUnityEquipment = 1,//线路驾驶设备
    LowerComputerCommucationEquipment = 2,//下位机通信设备
    TampingHomeworkEquipment = 3,//捣鼓设备
    //   GYKEquipment = 3,//GYK设备
};

//考试类型
enum ExamType{
    ExamineExam,
    RouteExam,
    TampingHomeworkExam,
    ExitType,
};

//考试模式类型
enum ExamPatternType{
    TrainingType,
    ExamType,
};

//设别映射
extern QHash<int, QPair<QString, int>> g_Client2Hash;
extern QHash<QPair<QString, int>, int> g_Hash2Client;

//账户
extern QString g_examineExamUnityAccount;
extern QString g_routeExamUnityAccount;
extern QString g_tampingHomeworkAccount;

//用户名
extern QString g_examineEquipmentUsername;
extern QString g_routeEquipmentUsername;
extern QString g_tampingHomeworkUsername;

//是否是在考试
extern bool g_isExecuteEquipmentExam;
extern bool g_isRouteEquipmentExam;
extern bool g_isTampingHomeworkEquipmentExam;


////考试表
//运行前检查的考试表创建时间戳
extern QString g_examineExamTableName;
extern qint64 g_examineExamCreatetimestamp;

//线路驾驶的考试表
extern QString g_routeExamTableName;
extern qint64 g_routeExamCreatetimestamp;

//捣固作业的考试表
extern QString g_tampingHomeworkTableName;
extern qint64 g_tampingHomeworkCreatetimestamp;


////缓存数据
//运行前检查
//运行前检查的每个步骤的得分（用于客户端被动或主动断开连接后，缓存之前的操作情况）
extern QHash<QString, int> g1_examSubstepNumberRecord;
//记录运行前检查的每个操作步骤
extern int g1_executeIndex;

//线路驾驶
extern QHash<QString, int> g2_examSubstepNumberRecord;
extern int g2_executeIndex;

//捣固作业
extern QHash<QString, int> g3_examSubstepNumberRecord;
extern int g3_executeIndex;


//超时统计
extern bool g_isExecuteEquipmentExamTimeout;
extern bool g_isRouteEquipmentExamTimeout;
extern bool g_isTampingHomeworkEquipmentExamTimeout;

//插入超时记录
extern bool g_insertExecuteEquipmentExamTimeoutRecord;
extern bool g_insertRouteEquipmentExamTimeoutRecord;
extern bool g_insertTampingHomeworkEquipmentExamTimeoutRecord;


//数据库的连接名
extern QString g_mainterfaceConnectDatabaseName_1;//信息总库
extern QString g_mainterfaceConnectDatabaseName_2;//车辆信息库
extern QString g_mainterfaceConnectDatabaseName_3;//成绩信息库


////语音
//环车检查设别的语音
extern QString g_voiceRecord1;
//线路驾驶设别的语音
extern QString g_voiceRecord2;
//捣固作业的语音
extern QString g_voiceRecord3;

#endif // GLOBAL_VARIANT_H
